package cn.mysource.org.service.impl;

import cn.mysource.basic.query.BaseQuery;
import cn.mysource.basic.service.impl.BaseServiceImpl;
import cn.mysource.basic.util.PageList;
import cn.mysource.org.domain.Department;
import cn.mysource.org.domain.Employee;
import cn.mysource.org.domain.Permission;
import cn.mysource.org.mapper.PermissionMapper;
import cn.mysource.org.query.PermissionQuery;
import cn.mysource.org.service.IPermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.ArrayList;
import java.util.List;
@Service
@Transactional(readOnly = true,propagation = Propagation.SUPPORTS)
public class PermissionServiceImpl extends BaseServiceImpl<Permission> implements IPermissionService {

//    @Autowired
//    private PermissionMapper mapper;
//
//    @Override
//    public Permission findById(Long id) {
//        return mapper.findById(id);
//    }
//
//    @Override
//    public List<Permission> findAll() {
//        return mapper.findAll();
//    }
//
//    @Override
//    public void add(Permission permission) {
//        mapper.add(permission);
//
//    }
//
//    @Override
//    public void delete(Long id) {
//        mapper.delete(id);
//
//    }
//
//    @Override
//    public void update(Permission permission) {
//            mapper.update(permission);
//    }
//
//
//
//    @Override
//    public List<Permission> queryByPage(BaseQuery query) {
//
//        List<Permission> rows = mapper.queryByPage(query);
//        Integer totals = mapper.queryByCount(query);
//        if (null == totals || 0 == totals) {
//            return (List<Permission>) new PageList<Permission>(0,new ArrayList<>());
//        }
//        return new PageList<> (totals,rows);
//
////        Integer totals = mapper.queryByCount(query);
////        if (null == totals || 0 == totals){
////            return new PageList<Permission>(0,new ArrayList<>());
////        }
////
////        // 查询数据把
////        List<Department> rows = mapper.queryByPage(query);
////        return new PageList<>(totals,rows);
//    }
//
//    @Override
//    public Integer queryByCount(BaseQuery query) {
//        Integer totals = mapper.queryByCount(query);
//        return null;
//    }
//
//    @Override
//    public void batchDelete(List<Long> ids) {
//        mapper.batchDelete(ids);
//    }
}
